import React, { Component } from 'react'
import Search from '../../components/GithubSearch/Search'
import List from '../../components/GithubSearch/List'
import './index.css'
export default class index extends Component {
  // 通过消息订阅 直接把状态放在list
  // state = {
  //   users: [],
  //   isFirst: true,//是否第一次打开页面
  //   isLoading: false,//是否处于加载中
  //   err: ''//错误信息
  // }
  // updateAppState = (appState) => {
  //   const {users, isFirst, isLoading, err} = appState
  //   console.log(users, isFirst, isLoading, err);
  //   this.setState({
  //     users,
  //     isFirst,
  //     isLoading,
  //     err
  //   })
  // }
  render() {
    return (
      <div>
        <div className="container">
          <Search updateAppState={this.updateAppState}/>
          <List {...this.state}/>
        </div>
      </div>
    )
  }
}
